<template>
	<view class="content" :style="{backgroundImage:`url(${detail.bg_image})`,paddingTop:bottom+'px'}">
		<image :style="{top:menuButtonInfo}" class="back" src="../../static/public/back.png" mode="" @click="back">
		</image>
		<view class="title bg f_zj">
			<image src="../../static/hd/title.png" mode=""></image>
		</view>
		<view class="rank bg">
			<view class="rank_box">
				<scroll-view scroll-y="true" class="rank_scroll">
					<view class="item" :class="{h_item:index>2}" v-for="(item,index) in detail.pm_info" :key="index">
						<view class="num">
							第{{index+1}}名
						</view>
						<view class="tel">
							{{item.mobile}}
						</view>
					</view>
				</scroll-view>
				<view class="btn f_zj" @click="go('/pages/activity/me_rank')">
					我的排名
				</view>
			</view>
		</view>
		<image class="go" src="../../static/hd/go.png" mode="widthFix"></image>
		<!-- <view class="me_box f_z">
			<view class="me_rank bg f_d f_j">
				<view class="avatar">
					<image :src="detail.u_info.avatar" mode="aspectFill"></image>
				</view>
				<view class="mc">
					第2名
				</view>
				<view class="lj">
					累计消费金额已达：<text>{{detail.u_info.money}}</text>元
				</view>
				<view class="jl">
					距离上一排名还差：<text>{{detail.u_info.s_money}}</text>元
				</view>
			</view>
		</view> -->
		<view class="jp_box">
			<view class="box">
				<view class="jp_item bg" @click="jp_view(index)" :class="[item?`item${index+1}`:'']"
					v-for="(item,index) in detail.multiplejson" :key="index">
					<image :src="item.zt_image" mode="widthFix"></image>
				</view>
				<!-- <view class="item2 jp_item bg" @click="jp_view(1)">

				</view>
				<view class="item3 jp_item bg" @click="jp_view(2)">

				</view>
				<view class="item4 jp_item bg" @click="jp_view(3)">

				</view>
				<view class="item5 jp_item bg" @click="jp_view(4)">

				</view>
				<view class="item6 jp_item bg" @click="jp_view(5)">

				</view>
				<view class="item7 jp_item bg" @click="jp_view(6)">

				</view> -->
			</view>
		</view>
		<view class="hd_gz_box f_z">
			<image class="gz_title" src="../../static/hd/hd_gz.png" mode=""></image>
		</view>
		<view class="rule_img">
			<image :src="detail.rule_image" mode="widthFix"></image>
		</view>
		<view class="to_top f_z">
			<image src="../../static/hd/to_top.png" mode="" @click="Totop"></image>
		</view>
	</view>
</template>

<script>
	import { mapState } from 'vuex'
	import { activity_info } from '@/api/page.js'
	export default {
		computed: {
			...mapState(['menuButtonInfo'])
		},
		data() {
			return {
				beasUrl: '',
				bottom: 0,
				detail: ''
			}
		},
		onLoad() {
			this.beasUrl = this.$beasUrl
			this.bottom = uni.getMenuButtonBoundingClientRect().bottom
			this.get_detail()
		},
		methods: {
			// 获取活动详情
			get_detail() {
				activity_info().then(res => {
					if (res.code == 1) {
						this.detail = res.data
					}
				})
			},
			Totop() {
				uni.pageScrollTo({
					scrollTop: 0, //滚动到页面的目标位置
					duration: 300
				});
			},
			jp_view(index) {
				let arr = []
				arr.push(this.detail.multiplejson[index].image)
				uni.previewImage({
					urls: arr,
				})
			}
		},

	}
</script>

<style lang="scss" scoped>
	.bg {
		background-repeat: no-repeat;
		background-size: 100%;
	}

	.content {
		background-repeat: no-repeat;
		background-size: 100%;

		.back {
			width: 40rpx;
			height: 40rpx;
			position: absolute;
			left: 30rpx;
		}

		.title {
			background-image: url(https://sc.51meteor.com/assets/addons/fzsc/img/title_bg.png);
			width: 100%;
			height: 332rpx;

			image {
				width: 414rpx;
				height: 284rpx;
			}
		}

		.rank {
			padding: 30rpx;
			box-sizing: border-box;
			background-image: url(https://sc.51meteor.com/assets/addons/fzsc/img/jp_bg.png);
			width: 100%;
			height: 800rpx;

			.rank_box {
				margin-top: -50rpx;
				margin-left: auto;
				width: 280rpx;
				box-sizing: border-box;
				padding: 20rpx;
				padding-bottom: 10rpx;
				border: 2rpx solid #FFFFFF;
				background-color: rgba(181, 127, 38, 0.5);
				border-radius: 30rpx;

				.rank_scroll {
					height: 650rpx;
					margin-bottom: 10rpx;
				}

				.item {
					margin-bottom: 10rpx;
					padding: 15rpx;
					background-color: #FFFFFF;
					color: rgb(255, 0, 11);
					border-radius: 20rpx;

					.num {
						font-size: 32rpx;
						font-weight: 600rpx;
					}

					.tel {
						margin-top: 10rpx;
						font-size: 24rpx;
					}
				}

				.h_item {
					background-color: rgb(249, 221, 171);
					color: rgb(110, 78, 16);
				}

				.btn {
					margin-bottom: 10rpx;
					height: 70rpx;
					border-radius: 1000rpx;
					background: linear-gradient(to right, rgb(12, 245, 114), rgb(3, 216, 196));
					color: #FFFFFF;
				}
			}
		}

		.go {
			width: 100%;
			margin-top: 30rpx;
		}

		.me_box {
			margin-top: 50rpx;

			.me_rank {
				background-image: url(https://sc.51meteor.com/assets/addons/fzsc/img/rank_bg.png);
				width: 458rpx;
				height: 208rpx;

				.avatar {
					margin-top: -70rpx;
					border-radius: 50%;
					overflow: hidden;
					border: 2rpx solid #FFFFFF;

					image {
						vertical-align: bottom;
						width: 80rpx;
						height: 80rpx;
					}
				}

				.mc {
					margin-top: 20rpx;
					padding: 6rpx 30rpx;
					color: #FFFFFF;
					border-radius: 1000rpx;
					background-color: rgb(246, 168, 103);
				}

				.lj,
				.jl {
					margin-top: 10rpx;
					font-size: 26rpx;
					color: rgb(247, 165, 53);

					text {
						font-size: 32rpx;
						color: rgb(255, 0, 11);
					}
				}
			}
		}

		.jp_box {
			padding: 30rpx;

			.box {
				background-color: rgba(255, 255, 255, 0.8);
				height: 900rpx;
				border-radius: 40rpx;
				position: relative;

				.jp_item {
					position: absolute;
					// height: 200rpx;
					background-image: url(https://sc.51meteor.com/assets/addons/fzsc/img/jp.png);

					image {
						width: 231rpx;
					}
				}

				.item1 {
					top: 350rpx;
					left: 230rpx;
				}

				.item2 {
					top: 150rpx;
					left: 15rpx;
				}

				.item3 {
					top: 60rpx;
					left: 230rpx;
				}

				.item4 {
					top: 150rpx;
					right: 15rpx;
				}

				.item5 {
					bottom: 200rpx;
					right: 15rpx;
				}

				.item6 {
					bottom: 30rpx;
					left: 230rpx;
				}

				.item7 {
					bottom: 200rpx;
					left: 15rpx;
				}
			}
		}

		.gz_title {
			margin-top: 30rpx;
			width: 690rpx;
			height: 156rpx;
		}

		.rule_img {
			padding: 30rpx;

			image {
				width: 100%;
			}
		}

		.to_top {
			image {
				margin-right: 40rpx;
				width: 526rpx;
				height: 212rpx;
			}
		}
	}
</style>